package com.cyf.db.mapper.smartCity;

import com.cyf.db.bean.LocalCarFlow;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LocalCarFlowMapper {

    @Select("select time_key, SUM(carNum) carNum " +
            "from local_carflow " +
            "where type = 1 and parkingId = #{parkingId} " +
            "and time_key >= '${timeKey}00' and time_key <= '${timeKey}23' " +
            "and deviceType = #{deviceType} and sentryboxid = #{sentryBoxId} " +
            "GROUP BY time_key")
    List<LocalCarFlow> listHourCarFlowByCondition(@Param("parkingId") Integer parkingId,
                                                  @Param("timeKey") String timeKey,
                                                  @Param("deviceType") Integer deviceType,
                                                  @Param("sentryBoxId") Integer sentryBoxId);
}
